﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DapperExtensions.Mapper;
using Newtonsoft.Json;
using ZLWeb.WebApiEntityBase;
using ZilLion.Service.Core.Domain.EntityBase.JsonConverter;

namespace ZL.CRM.CommonEntity.AccOpr
{
    public class HouzhYwCore : YwCoreCommon
    {
        /// <summary>
        ///  卡种id
        /// </summary>
        public int Oprcgsid { get; set; }

        /// <summary>
        ///  折扣类别id
        /// </summary>
        public int Oprdisid { get; set; }

        /// <summary>
        ///  押金
        /// </summary>
        public decimal Oprcdeposit { get; set; }

        /// <summary>
        ///  工本费
        /// </summary>
        public decimal Oprcfee { get; set; }

        /// <summary>
        ///  充值现金钱包
        /// </summary>
        public decimal Oprczxj { get; set; }

        /// <summary>
        ///  充值增值钱包
        /// </summary>
        public decimal Oprczzz { get; set; }

        /// <summary>
        ///  红包增值钱包开始使用日期
        /// </summary>
        [JsonConverter(typeof (ChinaDateTimeConverter))]
        public DateTime? Oprhbbegdate { get; set; }


        /// <summary>
        ///  红包增值钱包截止使用日期
        /// </summary>
        [JsonConverter(typeof (ChinaDateTimeConverter))]
        public DateTime? Oprhbenddate { get; set; }

        /// <summary>
        /// 折扣类别失效日期
        /// </summary>
        [JsonConverter(typeof (ChinaDateTimeConverter))]
        public DateTime? Oprzklbsxrq { get; set; }
    }
    public class HouzhYwCoreMapper : ClassMapper<HouzhYwCore>
    {
        public HouzhYwCoreMapper()
        {
            Table("#ywcore");
            Map(f => f.Oprcardno).Column("Oprcardno");
            Map(f => f.Oprctype).Column("Oprctype");
            Map(f => f.Oprcgsid).Column("Oprcgsid");
            Map(f => f.Oprdisid).Column("Oprdisid");
            Map(f => f.Oprcdeposit).Column("Oprcdeposit");
            Map(f => f.Oprcfee).Column("Oprcfee");
            Map(f => f.Oprtime).Column("Oprtime");
            Map(f => f.Oprbrid).Column("Oprbrid");
            Map(f => f.Oprbrname).Column("Oprbrname");
            Map(f => f.Oprczxj).Column("Oprczxj");
            Map(f => f.Oprczzz).Column("Oprczzz");
            Map(f => f.Opraccid).Column("Opraccid");
            Map(f => f.Oprsno).Column("Oprsno");
            Map(f => f.Oprhbbegdate).Column("Oprhbbegdate");
            Map(f => f.Oprhbenddate).Column("Oprhbenddate");
            Map(f => f.Oprzklbsxrq).Column("Oprzklbsxrq");

        }

    }
}
